<template>
  <border-box title="任务流转">
    <a-spin :spinning="loading">
      <a-timeline>
        <a-timeline-item v-for="item in list">
          <p>{{item.oprate}}</p>
          <p class="content">{{item.createTime}}</p>
          <p class="content">{{item.remark}}</p>
        </a-timeline-item>
      </a-timeline>
    </a-spin>
  </border-box>
</template>

<script>
  //任务流转
  import BorderBox from "./BorderBox";
  import {getAction} from "../../api/manage";

  export default {
    name: "TaskFlow",
    components: {BorderBox},
    props: ['params'],
    data() {
      return {
        loading: false,
        list: []
      }
    },
    created() {
      this.loadData();
    },
    methods: {
      loadData() {
        this.loading = true;
        getAction('task/taskInfo/queryTaskStep', this.params).then(res => {
          if (res.success) {
            this.list = res.result;
          }
        }).catch(error => console.log(error))
          .finally(() => {
            this.loading = false;
          })
      }
    }
  }
</script>

<style scoped>
  .content {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.45);
  }

</style>